<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:92:"/Users/doyi/project/east_environmental/public/../application/index/view/index/activity2.html";i:1548224254;s:78:"/Users/doyi/project/east_environmental/application/index/view/common/menu.html";i:1548224254;s:80:"/Users/doyi/project/east_environmental/application/index/view/common/footer.html";i:1548224254;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><?php echo (isset($title_name ) && ($title_name  !== '')?$title_name :'首页'); ?></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <script src="/index/js/jquery-1.9.1.min.js"></script>
    <script src="/index/js/layer.js"></script>
    <!---->
    <link rel="stylesheet" href="/index/libs/swiper3/css/swiper.min.css">
    <link rel="stylesheet" href="/index/libs/layui/css/layui.css">
    <link rel="stylesheet" href="/index/css/common.css">

    <!---->
    <script src="/index/libs/swiper3/js/swiper.min.js"></script>
    <script src="/index/libs/layui/layui.js"></script>


    <script src="/index/js/common.js"></script>
    <!--<script src="/index/js/index.js"></script>-->


    <link rel="stylesheet" href="/index/css/sales-activity2.css">
    <!---->
</head>

<body>
<div class="wrap">
    <header>
            <div class="nav wrap-w clearfix">
        <div class="fl nav-left">
            <a href="<?php echo url('index/index'); ?>" class="logo">
                <img src="/index/images/logo_04.png" alt="">
            </a>
            <a href="javascript:void(0)" class="city-select">
                <dl>
                    <dt>
                        <em class="city">全国</em><img src="/index/images/logo_06.png" alt="">
                    </dt>
                    <dd class="clearfix">
                        <p class="active"><span class="province" data="0">全国</span></p>
                        <?php foreach($province as $k=>$v): ?>
                        <p><span class="province" data="<?php echo $v['id']; ?>"><?php echo $v['province']; ?></span></p>
                        <?php endforeach; ?>
                    </dd>
                </dl>

            </a>
            <script>
                $('.province').click(function () {
                   var province_id =  $(this).attr('data');
                   window.location.href = '/index/index/index?province_id='+province_id;
                });
            </script>



            <a href="<?php echo url('index/index'); ?>" <?php if((isset($active))): if(($active == 1)): ?>class="active" <?php endif; endif; ?>>首页</a>
            <a href="<?php echo url('index/news_list',['type'=>1]); ?>" <?php if((isset($active))): if(($active == 3)): ?>class="active" <?php endif; endif; ?>>新闻中心</a>
            <a href="<?php echo url('index/activity'); ?>" <?php if((isset($active))): if(($active == 4)): ?>class="active" <?php endif; endif; ?>>促销活动</a>
            <a href="<?php echo url('index/public_info'); ?>" <?php if((isset($active))): if(($active == 2)): ?>class="active" <?php endif; endif; ?>>信息公开</a>
        </div>
        <div class="fr nav-right clearfix">
            <dl class="user">
                <dt>欢迎您！
                    <?php if((isset($user))): if((isset($user['realname']) && !empty($user['realname']))): ?>
                              <?php echo $user['user_name']; else: ?>
                    &nbsp;&nbsp;        <?php echo $user['user_name']; endif; else: ?>
                    <a href="<?php echo url('login/login'); ?>">登录</a>/<a href="<?php echo url('login/register'); ?>">注册</a>
                    <?php endif; ?>
                </dt>
                <?php if((isset($user))): ?>
                <div class="dd">
                    <dd>
                        <a href="<?php echo url('user/index',['type'=>2]); ?>"><img class="img-origin" src="/index/list0.png" alt=""><img class="img-active" src="/index/list1.png" alt="">我的订单</a>
                    </dd>
                    <!--<dd>-->
                        <!--<a href=""><img class="img-origin" src="/index/msg0.png" alt=""><img class="img-active" src="/index/msg1.png" alt="">我的邮件</a>-->
                    <!--</dd>-->
                    <dd>
                        <a href="<?php echo url('user/index'); ?>"><img class="img-origin" src="/index/set0.png" alt=""><img class="img-active" src="/index/set1.png" alt="">个人中心</a>
                    </dd>
                    <dd>
                        <a href="<?php echo url('login/login_out'); ?>"><img class="img-origin" src="/index/out1.png" alt=""><img class="img-active" src="/index/out0.png" alt="">退出登录</a>
                    </dd>
                </div>
                <?php endif; ?>
            </dl>
            <dl class="messages">
                <a href="<?php echo url('user/index',['type'=>3]); ?>"> <dt><img src="/index/images/img_06.png" alt=""></dt></a>
                <!--<div class="dd">-->
                    <!--<?php foreach($notice as $k=>$v): ?>-->

                    <!--<dd>-->
                        <!--<a href="">-->
                                <!--<?php if(($v['type'] == 1 )): ?>-->
                                <!--<span class="blue">【通知】</span>-->
                                <!--<?php endif; ?>-->
                                 <!--<?php if(($v['type'] == 2 )): ?>-->
                                <!--<span class="green">【公告】</span>-->
                                <!--<?php endif; ?>-->
                                 <!--<?php echo $v['system_title']; ?>-->
                                <!--<?php if(($k < 3)): ?>-->
                                 <!--<span class="dots"></span>-->
                                <!--<?php endif; ?>-->
                        <!--</a>-->
                    <!--</dd>-->
                    <!--<?php endforeach; ?>-->
                    <!--<dd class="more">-->
                        <!--<a href="">查看更多 ></a>-->
                    <!--</dd>-->
                <!--</div>-->

            </dl>
            <dl class="notice">
                <dt><img src="/index/images/img_72_06_03.png" alt=""><span>关注我们</span></dt>
                <div class="dd clearfix">
                    <h1>扫一扫关注我们</h1>
                    <dd class="fl">
                        <img src="/index/images/img_61.png" alt="">
                        <p>微信公众号“9999”</p>

                    </dd>
                    <dd class="fr">
                        <img src="/index/images/img_05.jpg" alt="">
                        <p>新浪微博“东方环保”</p>
                    </dd>

                </div>


            </dl>
        </div>
    </div>



        <div class="banner">
            <a href="">
                <img src="/index/images/sale_02.png" alt="">
            </a>
        </div>

    </header>

    <div class="container container-register">
        <div class="wrap-w">
            <div class="register-header clearfix">
                <!--<div class="labels fl">-->
                    <!--排序：<span  class="newest">最新</span>-->
                    <!--<span  class="hotest active">最热</span>-->
                <!--</div>-->
                <div class="fr">
                    <div class="search">
                        <input type="text" placeholder="请输入厂商名字" id="title">
                        <span class="search_title" style="cursor:pointer">搜索</span>
                    </div>
                </div>
            </div>
            <div class="user-center-content clearfix">
                <div class="user-center-left fl">
                    <dl>
                        <dt>相关分类</dt>
                        <div class="dd">
                            <!--<dd class="current"><a href="">应急预案</a></dd>-->
                            <!--<dd><a href="">清洁生产</a></dd>-->
                            <!--<dd><a href="">固废处理</a></dd>-->
                            <!--<dd><a href="">环评</a></dd>-->
                            <!--<dd><a href="">固废运输</a></dd>-->
                            <!--<dd><a href="">气处理</a></dd>-->
                            <!--<dd><a href="">水处理</a></dd>-->
                            <!--<dd><a href="">土壤</a></dd>-->
                            <!--<dd><a href="">环保设备</a></dd>-->
                            <!--<dd><a href="">委托检测</a></dd>-->
                        </div>

                    </dl>
                </div>
                <div class="user-center-right fr">
                    <div class="box-list">
                        <dl>
                            <div class="dd">

                                <div class="dt clearfix" style="display: block;" id="news-content">
                                    <!--<a href="/index/company/company_info.html" class=" fl w50">-->
                                        <!--<div class="img" style="background-image: url(/index/images/img_04_03.png)">haha</div>-->
                                        <!--<div class="p">-->


                                            <!--<p class="loc"><img src="/index/images/icon (1).png" alt="">地址:福建省福州市福清市渔溪镇下里村半边山</p>-->
                                            <!--<p class="number"><img src="/index/images/icon (2).png" alt="">许可证编号  FD9826230</p>-->
                                            <!--<p class="way"><img src="/index/images/icon (3).png" alt="">经营方式  RA-再循环/再利用金属和金属化合物，Y10-医疗废弃物，D9-固体废弃物...</p>-->
                                        <!--</div>-->
                                        <!--<span class="recommend"></span>-->
                                    <!--</a>-->
                                    <!--<a href="/index/company/company_info.html" class=" fl w25">-->
                                        <!--<div class="img" style="background-image: url(/index/images/img_04_03.png)">haha</div>-->
                                        <!--<div class="p">-->


                                            <!--<p class="loc"><img src="/index/images/icon (1).png" alt="">地址:福建省福州市福清市渔溪镇下里村半边山</p>-->
                                            <!--<p class="number"><img src="/index/images/icon (2).png" alt="">许可证编号  FD9826230</p>-->
                                            <!--<p class="way"><img src="/index/images/icon (3).png" alt="">经营方式  RA-再循环/再利用金属和金属化合物，Y10-医疗废弃物，D9-固体废弃物...</p>-->
                                        <!--</div>-->
                                        <!--<span class="recommend"></span>-->
                                    <!--</a>-->
                                    <!--<a href="/index/company/company_info.html" class=" fl w25">-->
                                        <!--<div class="img" style="background-image: url(/index/images/img_04_03.png)">haha</div>-->
                                        <!--<div class="p">-->


                                            <!--<p class="loc"><img src="/index/images/icon (1).png" alt="">地址:福建省福州市福清市渔溪镇下里村半边山</p>-->
                                            <!--<p class="number"><img src="/index/images/icon (2).png" alt="">许可证编号  FD9826230</p>-->
                                            <!--<p class="way"><img src="/index/images/icon (3).png" alt="">经营方式  RA-再循环/再利用金属和金属化合物，Y10-医疗废弃物，D9-固体废弃物...</p>-->
                                        <!--</div>-->
                                        <!--<span class="recommend"></span>-->
                                    <!--</a>-->
                                    <!--<a href="/index/company/company_info.html" class=" fl w25">-->
                                        <!--<div class="img" style="background-image: url(/index/images/img_04_03.png)">haha</div>-->
                                        <!--<div class="p">-->


                                            <!--<p class="loc"><img src="/index/images/icon (1).png" alt="">地址:福建省福州市福清市渔溪镇下里村半边山</p>-->
                                            <!--<p class="number"><img src="/index/images/icon (2).png" alt="">许可证编号  FD9826230</p>-->
                                            <!--<p class="way"><img src="/index/images/icon (3).png" alt="">经营方式  RA-再循环/再利用金属和金属化合物，Y10-医疗废弃物，D9-固体废弃物...</p>-->
                                        <!--</div>-->
                                        <!--<span class="recommend"></span>-->
                                    <!--</a>-->

                                </div>
                                <div class="null">暂无相关数据~~</div>
                            </div>
                        </dl>

                    </div>
                    <div class="pagnation" id="pagnation">
                </div>
            </div>

        </div>
    </div>
    <footer>
    <div class="footer-menu">

        <div class="wrap-w clearfix">
            <dl>
                <dt>
                    我们的服务
                </dt>
                <dd><a href="">线下服务</a></dd>
                <dd><a href="">订单系统</a></dd>
            </dl>
            <dl>
                <dt>
                    关于我们
                </dt>
                <dd><a href="">公司介绍</a></dd>
                <dd><a href="">团队介绍</a></dd>
                <dd><a href="">联系方式</a></dd>
            </dl>
            <dl>
                <div class="erwei fl">
                    <img src="/index/images/img_61.png" alt="">
                    <p>官方微信</p>
                </div>
                <div class="fl">
                    <dt>
                        联系我们
                    </dt>
                    <dd class="footer-phone"><a href=""><img src="/index/images/phone_03.png" alt="">400-222-8888</a></dd>
                    <dd><a href="javascript:void(0);">地址：福建省晋江市安东开发区</a></dd>
                </div>
            </dl>
            <!--<dl>-->
            <!--<dt>-->
            <!--联系我们-->
            <!--</dt>-->
            <!--<dd><a href=""><img src="/index/images/phone_03.png" alt="">400-222-8888</a></dd>-->
            <!--<dd><a href="javascript:void(0);">地址：福建省晋江市安东开发区</a></dd>-->
            <!--</dl>-->
        </div>
    </div>
    <p class="foot">Copyright©2015-2018，版权所有 东方环保 </p>
</footer>
    </div>

    <script>
        var articleEle = '';
        var cateEle = '';



        //订单方法
        function articleAjax(cate_id,content,pageSize,pageNo) {
            articleEle='';

            //渲染列表
            $.ajax({
                type: "POST",
                dataType: 'json',
                url: '/index/index/getCompanyList',
                data:{
                    cate_id:cate_id,
                    content:content,
                    pageSize:pageSize,
                    pageNo:pageNo

                },
                success: function (data) {
                    if (data.code == 200) {
                        if (data.data.data.length != 0 && data.data.data != null) {
                            var result = data.data.data;

                            window.localStorage.setItem('articleCount',data.data.count);
                            for (var i = 0; i < data.data.data.length; i++) {
                                articleFrame(result[i],i);
                                $('.pagnation').show();
                            }


                        }else{

                            $('.null').show();
                        }
                    }

                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                },
                complete: function () {

                }
            });

        }
        /*订单数据结构*/
        function articleFrame(result,i) {
            console.log(result.id);
            //订单html模板
            articleEle += '<a href="/index/company/company_info?id='+result.id+'" class=" fl">'
            articleEle +=' <div class="img" style="background-image: url(/index/images/img_04_03.png)">'+result.company_name+'</div>'
            articleEle +=' <div class="p">'
            articleEle +=' <p class="loc"><img src="/index/images/icon (1).png" alt="">地址:'+result.province+result.city+result.area+result.address+'</p>'
            articleEle +='<p class="number"><img src="/index/images/icon (2).png" alt="">许可证编号  **********</p>'
            articleEle +=' <p class="way"><img src="/index/images/icon (3).png" alt="">经营方式  </p>'
            articleEle +='  </div>'
            articleEle += '<span class="recommend"></span>'


            $('.null').hide();

            $('#news-content').html(articleEle);
            $('#news-content a').eq(4*(i-1)+1).addClass('w50').siblings().addClass('w25');

        }


        //类别方法
        function cateAjax() {
            cateEle='';

            //渲染列表
            $.ajax({
                type: "POST",
                dataType: 'json',
                url: '/index/index/getCate',

                success: function (data) {
                    if (data.code == 200) {
                        if (data.data.data.length != 0 || data.data.data != null) {
                            var result = data.data.data;
                            for (var i = 0; i < data.data.data.length; i++) {
                                cateFrame(result[i]);

                            }


                        }
                    }
                    initForm();
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                },
                complete: function () {

                }
            });

        }
        /*类别数据结构*/
        function cateFrame(result) {


            //订单html模板
            cateEle += '<dd data-id="'+result.id+'"><p class="a">'+result.cate_name+'</p></dd>'



            $('.user-center-left .dd').html(cateEle);
            $('.user-center-left .dd dd').eq(0).addClass('current');

        }

        function initForm () {
            //layui模块
            layui.use(['form', 'layedit', 'laydate','laypage'], function() {
                var form = layui.form
                        , layer = layui.layer
                        , layedit = layui.layedit
                        , laydate = layui.laydate
                        , laypage = layui.laypage;


                var articleCount = window.localStorage.getItem('articleCount');
                laypage.render({
                    elem: 'pagnation'
                    ,count: articleCount
//            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
                    ,layout: [ 'prev','page','next','count', 'skip']
                    ,limit:5
                    ,prev: '<em><</em>'
                    ,next: '<em>></em>'
                    ,jump: function(obj){
                        console.log(obj);
                        var pageSize = obj.limit;
                        var pageNo = obj.curr;

                        $('#news-content').html('');
                        var cate_id = $('.user-center-left .dd dd.current').attr('data-id');

                        articleAjax(cate_id,$('#title').val(),pageSize,pageNo);

                    }
                });



                $(document).on('click','.user-center-left .dd dd',function () {
                    $(this).addClass('current').siblings().removeClass('current');
                    var cate_id = $(this).attr('data-id');
                    $('#news-content').html('');
                    articleAjax(cate_id,$('#title').val(),5,1);
                })
                $('.search_title').on('click',function () {
                    $('#news-content').html('');
                    var cate_id = $('.user-center-left .dd dd.current').attr('data-id');
                    articleAjax(cate_id,$('#title').val(),5,1);

                })


                form.render();


            })
        }

        $(function () {
            cateAjax();
            window.localStorage.clear();

        })
    </script>

   